const Dog = require('./dog');

const taidi = new Dog('taidi', 5);
const zangao = new Dog('zangao', 8);

taidi.on('bark', () => {
  console.log(taidi.name + " barked! energy:" + taidi.energy);
});

zangao.on('bark', () => {
  console.log(zangao.name + " barked! energy:" + zangao.energy);
});